package xyz.quanguanjia.masterboy;

import android.text.TextUtils;

public class MBDPath2URLUtils {

    public static final String filePathPrefix = "file://";
    public static final String placeHolderGroupLogoPath = filePathPrefix + "ico_appicon";
    public static final String placeHolderAvatarPath = filePathPrefix + "ico_appicon";


    public static String wrapAvatarURL(String path){
        if (TextUtils.isEmpty(path)) {
            return placeHolderAvatarPath;
        }

        if (false == path.startsWith("http")){
            if (path.startsWith("/")){
                return MBDHostManager.IMAGE_HOST + path;
            } else {
                return MBDHostManager.IMAGE_HOST + "/" + path;
            }
        }

        return path;
    }
}
